package com.xiaoxu.intranetweb.mybatisplusSzappdb.vo.Constructor;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.dao.UserInfoDao;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.entity.SysUser;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.entity.TUserApproveConn;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.vo.GetUserApproveVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TUserApproveConn2GetUserApproveVo {
    @Autowired
    private UserInfoDao userInfoDao;
    public GetUserApproveVo getUserApproveVo(TUserApproveConn tUserApproveConn) throws Exception {
        GetUserApproveVo getUserApproveVo = new GetUserApproveVo();
        getUserApproveVo.setId(tUserApproveConn.getId());
        getUserApproveVo.setUserId(tUserApproveConn.getUserId());
        getUserApproveVo.setApproveTier(tUserApproveConn.getApproveTier());
        getUserApproveVo.setApproveId(tUserApproveConn.getApproveId());
        getUserApproveVo.setUserName(userInfoDao.getUser(tUserApproveConn.getUserId()).getTrueName());
        getUserApproveVo.setBranch(tUserApproveConn.getBranch());
        getUserApproveVo.setCreateBy(tUserApproveConn.getCreateBy());
        getUserApproveVo.setCreateTime(tUserApproveConn.getCreateTime());
        getUserApproveVo.setCreatorName(userInfoDao.getUser(tUserApproveConn.getCreateBy()).getTrueName());
        return getUserApproveVo;
    }
}
